Skip to content

fix: resolve all 9 SonarCloud reliability bugs#40

Merged
aksOps merged 1 commit into
mainfrom
fix/reliability-bugs
Apr 4, 2026
Merged

fix: resolve all 9 SonarCloud reliability bugs#40
aksOps merged 1 commit into
mainfrom
fix/reliability-bugs

Conversation

@aksOps

@aksOps aksOps commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 9 open SonarCloud reliability bugs (type=BUG) to pass the quality gate.

Bugs Fixed

# Rule File Fix
1 S2159 GitHubActionsDetector Boolean.TRUE.equals(key) compared Boolean to String map key — changed to "true".equals(String.valueOf(key))
2-3 S5998 NestJSControllerDetector Nested regex quantifiers risked stack overflow — added possessive *+
4 S5850 CSharpStructuresDetector Ambiguous alternation (^/+|/+$) — split to (^/+)|(/+$)
5 S5855 GrpcServiceDetector void|[\w<>\[\]]+ redundant — simplified to [\w<>\[\]]+
6-8 S5998 RawSqlDetector ([^"\\]*(?:\\.[^"\\]*)*) nested * — added possessive *+
9 S3655 JpaEntityDetector Optional.get() without prior isPresent() — stored Optional in variable

Test plan

  • All 3219 tests pass (0 failures, 0 errors)
  • 6 files changed, minimal diffs (11 insertions, 10 deletions)

🤖 Generated with Claude Code

- S2159: GitHubActionsDetector — equals() on unrelated types
  (Boolean.TRUE.equals(key) → "true".equals(String.valueOf(key)))
- S5998: NestJSControllerDetector L44,48 — regex stack overflow
  (added possessive quantifiers *+ to nested groups)
- S5850: CSharpStructuresDetector L214 — regex precedence
  ((^/+|/+$) → (^/+)|(/+$) with explicit grouping)
- S5855: GrpcServiceDetector L36 — redundant regex alternative
  (removed void| since [\w<>\[\]]+ already matches it)
- S5998: RawSqlDetector L30,35,37 — regex stack overflow
  (added possessive quantifiers *+ to nested groups)
- S3655: JpaEntityDetector L201 — Optional accessed without isPresent
  (stored Optional in variable before isPresent + get)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

@aksOps aksOps merged commit a3088ae into main Apr 4, 2026
10 checks passed
@aksOps aksOps deleted the fix/reliability-bugs branch April 26, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant